package com.sumainfor.wx.system.maket.controller.rentadviser;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.system.feign.BaseFeignMarket;
import com.sumainfor.wx.system.maket.service.RdWorderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * <p>
 * 工单详表
 * <p>
 *
 * @author: zc
 * @create: 2019-08-15 10:55
 **/
@Controller
@RequestMapping("/RdWorderInfoController")
public class RdWorderInfoController {

    @Autowired
    RdWorderInfoService rdWorderInfoService;

    @Autowired
    BaseFeignMarket baseFeignMarket;



    /**
     * 确认到达 （废弃）
     * @author zhoucong
     * @data 2019/8/15
     * @Param
     * @return
     */
//    @ResponseBody
//    @PostMapping("/updateWorderInfoIfArrive")
//    public JsonResult updateWorderInfoIfArrive(@RequestBody Map<String,Object> params){
//        return rdWorderInfoService.updateWorderInfoIfArrive(params);    }




    /**
     * 工单确认到达
     * @author zhoucong
     * @data 2019/9/4
     * @Param
     * @return
     */
    @ResponseBody
    @PostMapping("/updateWorderInfoIfArrive")
    public JsonResult updateWorderInfoIfArrive(@RequestBody Map<String,Object> params){
        return baseFeignMarket.updateWorderInfoIfArrive(params);
    }








    /**
      *  完成带看
      * @author zhoucong
      * @data 2019/8/15
      * @Param
      * @return
      */
    @ResponseBody
    @PostMapping("/updateWorderInfoIfArriveWan")
    public JsonResult updateWorderWan(@RequestBody Map<String,Object> params){
        return rdWorderInfoService.updateWorderWan(params);
    }

    /**
     * 取消订单
     * @author zhoucong
     * @data 2019/8/16
     * @Param
     * @return
     */
    @ResponseBody
    @PostMapping("/updateWorderInfoState")
    public JsonResult updateWorderInfoState(@RequestBody Map<String,Object> params){
        return rdWorderInfoService.updateWorderInfoState(params);
  }


  /**
   * 转同事
   * @author zhoucong
   * @data 2019/8/16
   * @Param
   * @return
   */
    @ResponseBody
    @PostMapping("/updateTurn")
    public JsonResult updateTurn(@RequestBody Map<String,Object> params){
        return rdWorderInfoService.updateTurn(params);
    }


    /**
     * 修改时间
     * @author zhoucong
     * @data 2019/8/16
     * @Param
     * @return
     */
    @ResponseBody
    @PostMapping("/updateSeTime")
    public JsonResult updateSeTime(@RequestBody Map<String,Object> params){
        return rdWorderInfoService.updateSeTime(params);
    }


    /**
     * 拒绝转单
     * @author zhoucong
     * @data 2019/8/19
     * @Param
     * @return
     */
    @ResponseBody
    @PostMapping("/updateRdTurn")
    public JsonResult updateRdTurn(@RequestBody Map<String,Object>params){
        return rdWorderInfoService.updateRdTurn(params);
    }


    /**
     * 接受转单
     * @author zhoucong
     * @data 2019/8/19
     * @Param
     * @return
     */
    @ResponseBody
    @PostMapping("/addWorderOrWorderInfo")
    public JsonResult addWorderOrWorderInfo(@RequestBody Map<String,Object> params){
        return baseFeignMarket.addWorderOrWorderInfo(params);
    }

}
